package Basepractice.P2017_11_1;

/**
 * Created by Administrator on 2017/11/2.
 */
//分别用for语句、while语句、do while语句编写程序：求1至n之间能被m整除的整数之和
public class Dowhile {
    public static void main(String[] args) {
        int i,n,m;long sum;
        sum=0;
        i=0;n=10;m=5;
        do {
            if (i % m == 0) {
                sum = sum + i;
            }i++;
        }     while (i<=n);
        System.out.println(sum);

    }

}
